// components/tag-area/tag-area.js
import {storeBindingsBehavior} from "mobx-miniprogram-bindings"
import {store} from "../../store/store"
Component({
  behaviors:[storeBindingsBehavior],
  storeBindings:{
    store,
    fields:{
      categoryList:"categoryList",
      activeCategory:"activeCategory"
    },
    actions:{
      updateActiveCatory:"updateActiveCatory",
    },
  },
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    tapHandler(e){
      if(e.target.dataset.item.category_id!=this.data.activeCategory.category_id){
        this.updateActiveCatory(e.target.dataset.item)
      }
    }
  },
  lifetimes:{
    ready(){

    }
  }
})
